﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Icinetic.FeedCategorySample.Entities;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;


namespace Icinetic.FeedCategorySample.Services.Test
{
    [TestClass]
    public class ContentServiceTest
    {
        [TestMethod]
        public async Task GetItemsNullFeedPathTest()
        {
            try
            {
                ContentService contentService = new ContentService((string)null);

                Dictionary<string, List<RssItem>> feedDictionary = new Dictionary<string, List<RssItem>>();
                feedDictionary = await contentService.GetItems<RssItem>(feedDictionary);

                Assert.Fail("No exception thrown");
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex is FileNotFoundException);
            }
        }
    }
}
